#pragma once

#include <map>

using std::map;

#define ACTION_PAINT	0xFFF0
#define ACTION_RESIZE	0xFFF1
#define ACTION_NONE		0xFFFF

#define VK_NUM_PAD_0	0X80
#define VK_NUM_PAD_1	0X81
#define VK_NUM_PAD_2	0X82
#define VK_NUM_PAD_3	0X83
#define VK_NUM_PAD_4	0X84
#define VK_NUM_PAD_5	0X85
#define VK_NUM_PAD_6	0X86
#define VK_NUM_PAD_7	0X87
#define VK_NUM_PAD_8	0X88
#define VK_NUM_PAD_9	0X89

class CaretInfo
{
public:
	CaretInfo(int width, int height);
    virtual ~CaretInfo(void);

	void Create(CWnd* wnd);
	void Destroy();

	void SetPosition(bool bShow,const CPoint* point = NULL);
	CPoint& Position();
	void Hide();

	void SetInfo(const int cellWidth,const CString* strInfo = NULL);
	CString& Info();
	void SetCellWidth(const int cellWidth);

	void Update(CDC* dc,UINT action);

	bool IsDisplayed();
	
	int  Action();
private:
	CWnd*							_wnd;
	CPoint							_point;
	bool							_isDisplayed;
	bool							_isCreated;
	CString							_info;
	int								_cellWitdh;
 	int								_width;
	int								_height;
	int							    _lastAction;
	map<UINT,WCHAR>		 			_acceptedChars;
	int								_posInInfo;
};

